<?php
/**
 * Created by PhpStorm.
 * User: zyw
 * Date: 2018-04-08
 * Time: 16:19
 */

class AppLog extends MY_Controller{

    public function __construct(){
        parent::__construct();
    }

    /**
     * app日志列表
     */
    public function get_list(){
        $pageTitle = "app日志列表";

        $page = $this->input->get_post("page") ? $this->input->get_post("page") : 1;
        $pagesize = $this->input->get_post("pagesize") ? $this->input->get_post("pagesize") : 20;
        $where = array();
        $orderBy = array("add_time" => time());
        $appLogList = $this->AppLogModel->getList($where, $page, $pagesize, $orderBy);
        $num = $this->AppLogModel->getListNum($where);

        $url = "index.php?c=appLog&m=get_list";
        $multipage = multipage($num, $page, $pagesize, $url);

        $this->load->view('appLog/get_list',array(
            "pageTitle" => $pageTitle,
            "appLogList" => $appLogList,
            "multipage" => $multipage
        ));
    }

    /**
     * 日志详情
     */
    public function log_detail(){
        $id = $this->input->get_post('id');
        $appError = $this->AppLogModel->query_one(array("id" => $id));

        std_out(0, "", array("msg" => $appError["msg"]));
    }
}